package com.nercel.dsj.gksales.service;

import com.nercel.dsj.gksales.model.ListResult;
import com.nercel.dsj.gksales.model.QueryParams;
import com.nercel.dsj.gksales.model.dto.AgentCreateParamsDTO;
import com.nercel.dsj.gksales.model.dto.AgentResultDTO;
import com.nercel.dsj.gksales.model.entity.Agent;

import java.util.List;
import java.util.Map;

/**
 * @author sunlin
 * @date 2019-4-12
 */
public interface AgentService {

	ListResult<AgentResultDTO> listWithPaging(QueryParams queryParams);

	void save(Agent t);

	void update(Agent t);

	AgentResultDTO findById(Integer id);

	AgentResultDTO findByUserId(Integer id);

	void delete(Integer id);

	void deleteByUserId(Integer id);

	/**
	 * 额度转移
	 * @param srcAgentId
	 * @param targetAgentId
	 * @param amount
	 */
	void transfer(Integer srcAgentId, Integer targetAgentId, Integer amount);

	/**
	 * 给代理用户增加amount
	 * @param userId
	 * @param amount
	 */
	Integer increaseAmount(Integer userId, Integer amount);

	/**
	 * 注册代理商
	 * @param agentParamsDTO
	 */
	Integer createAgentAccount(AgentCreateParamsDTO agentParamsDTO);

	/**
	 * 统计
	 */
	List<Map<String, Object>> statistics(QueryParams params);

}
